bool canConstruct(char* ransomNote, char* magazine) {
    int a[26]={0};
    for(int i=0;magazine[i]!='\0';i++){
        a[magazine[i]-'a']++;
    }
    for(int i=0;ransomNote[i]!='\0';i++){
        int t = a[ransomNote[i]-'a'];
        if(t>0){
            t--;
            a[ransomNote[i] - 'a'] = t;
        }else{
            return false;
        }
    }
    return true;
}